﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Warensoft.SocketConsole
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            this.server.ChannelCreated += new EventHandler<Socket.EventArgs.ChannelEventArgs>(server_ChannelCreated);
            this.server.ChannelRemoved += new EventHandler<Socket.EventArgs.ChannelEventArgs>(server_ChannelRemoved);
            this.server.ClientDisconnected += new EventHandler(server_ClientDisconnected);
            this.server.MessageSent += new EventHandler(server_MessageSent);
            this.server.NewMessage += new EventHandler(server_NewMessage);
            this.server.NewSocket += new EventHandler<Socket.EventArgs.NewSocketEventArgs>(server_NewSocket);
            this.server.ServerEvent += new EventHandler<Socket.EventArgs.MessageEventArgs>(server_ServerEvent);

        }
        Warensoft.SocketImplementation.WarensoftSocketServer server = new SocketImplementation.WarensoftSocketServer();
        private void btStart_Click(object sender, RoutedEventArgs e)
        {
            this.server.Start();
        }

        void server_ServerEvent(object sender, Socket.EventArgs.MessageEventArgs e)
        {
            this.listBox1.Items.Add(e.Message );
        }

        void server_NewSocket(object sender, Socket.EventArgs.NewSocketEventArgs e)
        {
            
        }

        void server_NewMessage(object sender, EventArgs e)
        {
            
        }

        void server_MessageSent(object sender, EventArgs e)
        {
            
        }

        void server_ClientDisconnected(object sender, EventArgs e)
        {
            
        }

        void server_ChannelRemoved(object sender, Socket.EventArgs.ChannelEventArgs e)
        {
            
        }

        void server_ChannelCreated(object sender, Socket.EventArgs.ChannelEventArgs e)
        {
            
        }
    }
}
